Skip to content

Conversation

syjn99
Copy link
Contributor

@syjn99 syjn99 commented Oct 17, 2025

What type of PR is this?

Feature

What does this PR do? Why is it needed?

This PR adds those endpoints:

  • /prysm/v1/beacon/states/{state_id}/query
  • /prysm/v1/beacon/blocks/{block_id}/query
    which follows the endpoint specification.

I added three SSZ containers for response:

class SSZQueryProof(Container):
    leaf: Bytes32
    gindex: uint64
    proofs: List[Bytes32, SSZ_QUERY_MAX_TREE_DEPTH]

class SSZQueryResponse(Container):
    root: Bytes32
    result: ByteList[SSZ_QUERY_MAX_RESULT_LENGTH]
    
class SSZQueryResponseWithProof(Container):
    root: Bytes32
    result: ByteList[SSZ_QUERY_MAX_RESULT_LENGTH]
    proof: Proof

Which issues(s) does this PR fix?

Part of #15587: Expose SSZ-QL as a new endpoint.

Other notes for review

  • After discussion with @rkapka, we decided to 1) return in SSZ encoded bytes and 2) only support a single query at this moment.
  • The existing containers for testing (e.g., VariableTestContainer) were moved to a new package (github.com/OffchainLabs/prysm/v6/proto/ssz_query/testing) that only has test-only containers. (which results in big LOC 😅)
  • sszInfo is modifed to be public, as it is also used in RPC package.
  • include_proof is not yet implemented, so the flag is ignored and always return the response without proof.
  • Spec document must be helpful to review this PR. Examples will give some real-world examples.

Acknowledgements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant